home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
4_7.lha
/
4_7
/
4_7c.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
569b
|
27 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
include <tnode.h>
include <stream.h>
/ print a node's value and reference count,
/ indented by the depth, followed by the
/ left and right subtrees
tatic void prnode(tnode *leaf, int level)
if (leaf)
{
cout << str("", level) << leaf->tword << " " <<
leaf->count << "\n";
prnode(leaf->left, level+1);
prnode(leaf->right, level+1);
}
/ print out the tree
oid printtree(tree treeheadptr)
prnode(*treeheadptr, 0);